<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

class Shop extends Model
{
    public $table = 'shop';

    public $guarded = [];

    public $casts = [
       'yycs' => 'json',
       'hzxysqb' => 'json'
    ];

    public function bank()
    {
        return $this->hasOne(ShopBank::class, 'shop_id', 'id');
    }

    public function staff()
    {
        return $this->hasOne(ShopStaff::class, 'shop_id', 'id');
    }

    public function agent()
    {
        return $this->belongsTo(Agent::class, 'agent_id', 'id');
    }

    public function agentHasShop()
    {
        return $this->hasMany(AgentHasShop::class);
    }
}
